package com.he1618.controller;

import com.he1618.MyCountService;
import com.he1618.MyMSummaryService;
import com.he1618.MyService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StateController {

    @Resource
    private MyCountService myCountService;

    @Resource
    private MyMSummaryService myMSummaryService;

    @Resource
    private MyService myService;

    @RequestMapping("/state")
    public String state(){
        myCountService.incrementCounter();
        myMSummaryService.recordValue(Math.random());
        myService.performOperation();
        return "ok";
    }
}
